org.eclipse.vtp.desktop.projects.core.internals
Class Database

java.lang.Object
  extended by org.eclipse.vtp.desktop.projects.core.internals.VoiceResource
      extended by org.eclipse.vtp.desktop.projects.core.internals.Database
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, IDatabase, ObjectListener, IVoiceToolsResource

public class Database
extends VoiceResource
implements IDatabase

This is a concrete implementation of IDatabase and provides the default behavior of that interface.

Version:
2.0
Author:
Trip Gilman

Constructor Summary
Database(DatabaseSet databaseSet, org.eclipse.core.resources.IFolder folder)
          Creates a new Database with the given parent database set and eclipse folder resource.
 
Method Summary
 IDatabaseTable createTable(java.lang.String name)
          Creates a new database table definition with the given name.
 void delete()
           
 boolean equals(java.lang.Object obj)
           
 java.lang.String getName()
           
protected  java.lang.String getObjectId()
          The object id is used by the event system to uniquely identify a project resource.
 IVoiceToolsResource getParent()
          Returns the parent of this resource.
 java.util.List getTables()
           
 
Methods inherited from class org.eclipse.vtp.desktop.projects.core.internals.VoiceResource
addRefreshListener, deferEvents, finalize, getAdapter, getProject, processObjectEvent, refresh, removeRefreshListener, resumeEvents
 
Methods inherited from class java.lang.Object
clone, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.vtp.desktop.projects.core.IVoiceToolsResource
addRefreshListener, deferEvents, getProject, refresh, removeRefreshListener, resumeEvents
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

Database

public Database(DatabaseSet databaseSet,
                org.eclipse.core.resources.IFolder folder)
Creates a new Database with the given parent database set and eclipse folder resource.

Parameters:
databaseSet - The parent database set
folder - The eclipse folder resource this database represents
Method Detail

getObjectId

protected java.lang.String getObjectId()
Description copied from class: VoiceResource
The object id is used by the event system to uniquely identify a project resource. In this fashion, multiple references to the resource can be created and still be notified of events.

Specified by:
getObjectId in class VoiceResource
Returns:
A unique identifier for this resource

getName

public java.lang.String getName()
Specified by:
getName in interface IVoiceToolsResource
Returns:
The name of the resource

getTables

public java.util.List getTables()
Specified by:
getTables in interface IDatabase
Returns:
The list of IDatabaseTables that are defined for this database

getParent

public IVoiceToolsResource getParent()
Description copied from interface: IVoiceToolsResource
Returns the parent of this resource. If this is a project resource this function returns this.

Specified by:
getParent in interface IVoiceToolsResource
Returns:
The parent of this resource resource

createTable

public IDatabaseTable createTable(java.lang.String name)
                           throws org.eclipse.core.runtime.CoreException
Description copied from interface: IDatabase
Creates a new database table definition with the given name. The table will initially have no columns but all file and folder resources related to this new table will be created as part of this action.

Specified by:
createTable in interface IDatabase
Parameters:
name - The name of the new table definition
Returns:
The new database table
Throws:
org.eclipse.core.runtime.CoreException - If an error occured while creating the required file or folder resources of this database table definition

delete

public void delete()
            throws org.eclipse.core.runtime.CoreException
Specified by:
delete in interface IDatabase
Throws:
org.eclipse.core.runtime.CoreException

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object